import { useMemo } from "react"
export default function useMergeProps(componentProps, defaultProps) {

    const props = useMemo(() => {
        const _props = { ...componentProps }
        for (const propName in defaultProps) {
            if (componentProps[propName] === undefined) {
                _props[propName] = defaultProps[propName]
            }
        }
        return _props
    }, [componentProps, defaultProps])
    return props
}